using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using emp.ProcessFlow;
using emp.BLL;
using emp.Model;
using emp.Utility;

public partial class crm_campaign_ChannelList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            gview(0);

            
        }

    }
    protected void DeleteByCha_UID(object sender, System.EventArgs e)
    {
        int cha_uid = Int32.Parse(((LinkButton)sender).CommandArgument);
        ChannelController chaController = new ChannelController();
        chaController.Delete(cha_uid);

    }

    protected void PageChanged(object sender, GridViewPageEventArgs e)
    {

        gview(e.NewPageIndex);

    }

    protected void query_Click(object sender, EventArgs e)
    {
        gview(0);
    }

    private void gview(int page)
    {

        channelList.PageIndex = PageUtil.getGviewNewPage(channelList, page);
        emp.BLL.Channel channel = new emp.BLL.Channel();
        IList clist = channel.selectChannelList(this.cha_name.Text, this.event_time.Text, this.CHA_TYPE.SelectedValue);
        
        this.channelList.DataSource = clist;
        this.channelList.DataBind();

        PageUtil.setPageCount(channelList, clist);
        
    }
}
